<?php
/**
 * Cameo Library
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 *
 * @category   Cameo
 * @package    Cameo_SMS
 * @copyright  Copyright (c) 2008 Sylvain Filteau (http://www.cidsphere.com)
 */

/**
 * Factory class to create a gateway
 *
 * @category   Cameo
 * @package    Cameo_SMS
 * @copyright  Copyright (c) 2008 Sylvain Filteau (http://www.cidsphere.com)
 */
class Cameo_SMS {
	
	/**
	 * Factory method that creates an SMS gateway to send message to a mobile phone.
	 * 
	 * This library supports
	 * <ul>
	 * 	<li>Clickatell_Http</li>
	 * </ul>
	 *
	 * @param string $gateway_name The name of the gateway class name
	 * @param array $default_options default options that the gateway will use to send message.
	 * @return Cameo_SMS_Gateway_Abstract
	 */
	public static function factory($gateway_name, array $default_options = array()) {
		$gateway_class_file_name = str_replace('_', '/', $gateway_name) . '.php';
		require_once('Cameo/SMS/Gateway/' . $gateway_class_file_name);
		
		$class_name = 'Cameo_SMS_Gateway_' . $gateway_name;
		
		return new $class_name($default_options);
	}
	
}